package org.jeecg.modules.complain.vo;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 投诉统计
 * @Author liurui
 * @Date 2019/10/07 18:21
 * @Version 1.0
 **/
@Data
public class ComplainReport implements Serializable {
    private Integer total; //投诉总数
    private Integer completeNum; //已处理
    private BigDecimal percent; //完成率

    public BigDecimal getPercent() {
        if (total == null || total == 0){
            return BigDecimal.ZERO;
        }
        if (completeNum == null || completeNum == 0){
            return BigDecimal.ZERO;
        }
        this.percent = new BigDecimal(completeNum).multiply(new BigDecimal(100)).divide(new BigDecimal(total),1,BigDecimal.ROUND_HALF_UP);
        return percent;
    }
}
